"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));

var _jsxRuntime = require("react/jsx-runtime");

var _antdV = require("antd-v4");

var _react = _interopRequireDefault(require("react"));

var _createField = require("../../BaseForm/createField");

/**
 * 文本选择组件
 *
 * @param
 */
var BaseProFormSlider = function BaseProFormSlider(_ref, ref) {
  var fieldProps = _ref.fieldProps,
      min = _ref.min,
      max = _ref.max,
      step = _ref.step,
      marks = _ref.marks,
      vertical = _ref.vertical,
      range = _ref.range;
  return (0, _jsxRuntime.jsx)(_antdV.Slider, (0, _objectSpread2.default)((0, _objectSpread2.default)({
    min: min,
    max: max,
    step: step,
    marks: marks,
    vertical: vertical,
    range: range
  }, fieldProps), {}, {
    ref: ref
  }));
};

var ProFormSlider = (0, _createField.createField)( /*#__PURE__*/_react.default.forwardRef(BaseProFormSlider), {
  lightFilterLabelFormatter: function lightFilterLabelFormatter(value) {
    if (Array.isArray(value)) {
      return value.join('~');
    }

    return value;
  }
});
var _default = ProFormSlider;
exports.default = _default;